# logger_config.py
import logging

# 配置日志记录器
logging.basicConfig(level=logging.INFO,
                    format='%(asctime)s  [%(levelname)s] %(message)s',
                    handlers=[
                        logging.FileHandler("log.txt", encoding="utf8"),
                        logging.StreamHandler()
                    ])

# 创建一个logger实例
logger = logging.getLogger('logger')
